package day01;

import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入0——1000的整数:");
         int a = scanner.nextInt();
         if (0 <= a && a <= 1000){
               int n =  a/100;        // 9
               int m = (a%100)/10;
               int p = (a%100)%10;    // 2
               int sum1 =m+n+p;
                 System.out.println("当a>=100的值为："+ sum1);
             } else {
                System.out.println("对不起，您输入的数值必须符合规定哦!");
            }


    }
}
